package io.github.luons.mediator.dsl.service;

import java.util.List;
import java.util.Map;

/**
 * baseService query
 *
 * @author luons
 */
public interface BaseQueryService<T> {

    /**
     * query database by entity
     *
     * @param entity entity
     * @return List<T>
     */
    List<T> findAndSearchByEntity(T entity);

    /**
     * query database by Map
     *
     * @param params params
     * @return List<T>
     */
    List<T> findAndSearchByMap(Map<String, Object> params);

    /**
     * query by params filter
     *
     * @return List<T>
     */
    List<T> findAndSearchByFilters();

    /**
     * query by params filter
     *
     * @param clazz clazz
     * @return List<R>
     */
    <R> List<R> findAndSearchByFilters(Class<R> clazz);

    /**
     * query by params filter
     *
     * @return List<Map>
     */
    List<Map<String, Object>> findAndSearchMapsByFilters();

}
